import request from '@/utils/request'
import { getHost, getHeaderType } from '@/utils/host'

export function getPageFriend(data) {
  return request({
    method: 'post',
    url: '/friend/getPageFriend',
    baseURL: getHost(),
    data: data,
    headers: getHeaderType()
  })
}

export function updateStatusById(data) {
  return request({
    method: 'get',
    url: '/friend/updateStatus',
    baseURL: getHost(),
    params: data,
    headers: getHeaderType()
  })
}

export function saveFriend(data) {
  return request({
    method: 'post',
    url: '/friend/saveFriend',
    baseURL: getHost(),
    data: data,
    headers: getHeaderType()
  })
}

export function updateFriend(data) {
  return request({
    method: 'post',
    url: '/friend/updateFriend',
    baseURL: getHost(),
    data: data,
    headers: getHeaderType()
  })
}

export function getFriendById(id) {
  return request({
    method: 'get',
    url: '/friend/getFriendById',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}

export function delArticle(id) {
  return request({
    method: 'post',
    url: '/friend/delFriend',
    baseURL: getHost(),
    params: { id: id },
    headers: getHeaderType()
  })
}
